//
//  tmpView2.m
//  MyFrameWork
//
//  Created by eason on 16/4/27.
//  Copyright © 2016年 普惠. All rights reserved.
//

#import "tmpView2.h"
#import "ViewController.h"

@implementation tmpView2

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.backgroundColor = [UIColor blueColor];
        button.frame = CGRectMake(100, 100, 80, 80);
        [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:button];
    }
    return self;
}
- (void)buttonAction
{
    ViewController * vc = [[ViewController alloc] init];
    //    [self pushToViewController:vc animated:YES];
    [self pushViewController:vc animated:YES];
}
@end
